.include "asm/include/battle_commands.inc"

.data

_000:
    CompareMonDataToValue OPCODE_EQU, BATTLER_CATEGORY_SIDE_EFFECT_MON, BMON_DATA_HELD_ITEM, ITEM_ELECTRIC_SEED, _raiseDefense
    CompareMonDataToValue OPCODE_EQU, BATTLER_CATEGORY_SIDE_EFFECT_MON, BMON_DATA_HELD_ITEM, ITEM_GRASSY_SEED, _raiseDefense
    CompareMonDataToValue OPCODE_EQU, BATTLER_CATEGORY_SIDE_EFFECT_MON, BMON_DATA_HELD_ITEM, ITEM_MISTY_SEED, _raiseSpDefense
    CompareMonDataToValue OPCODE_EQU, BATTLER_CATEGORY_SIDE_EFFECT_MON, BMON_DATA_HELD_ITEM, ITEM_PSYCHIC_SEED, _raiseSpDefense

_end:
    UpdateVar OPCODE_FLAG_OFF, BSCRIPT_VAR_BATTLE_STATUS_2, BATTLE_STATUS2_UPDATE_STAT_STAGES
    UpdateVar OPCODE_FLAG_OFF, BSCRIPT_VAR_BATTLE_STATUS_2, BATTLE_STATUS2_STAT_STAGE_CHANGE_SHOWN
    RemoveItem BATTLER_CATEGORY_SIDE_EFFECT_MON
    End 

_raiseDefense:
    UpdateVar OPCODE_SET, BSCRIPT_VAR_MESSAGE, STAT_DEFENSE
    UpdateVarFromVar OPCODE_SET, BSCRIPT_VAR_MSG_BATTLER_TEMP, BSCRIPT_VAR_BATTLER_STAT_CHANGE
    UpdateMonDataFromVar OPCODE_GET, BATTLER_CATEGORY_SIDE_EFFECT_MON, BMON_DATA_HELD_ITEM, BSCRIPT_VAR_MSG_ITEM_TEMP
    Call BATTLE_SUBSCRIPT_HELD_ITEM_RAISE_STAT
    GoTo _end

_raiseSpDefense:
    UpdateVar OPCODE_SET, BSCRIPT_VAR_MESSAGE, STAT_SPECIAL_DEFENSE
    UpdateVarFromVar OPCODE_SET, BSCRIPT_VAR_MSG_BATTLER_TEMP, BSCRIPT_VAR_BATTLER_STAT_CHANGE
    UpdateMonDataFromVar OPCODE_GET, BATTLER_CATEGORY_SIDE_EFFECT_MON, BMON_DATA_HELD_ITEM, BSCRIPT_VAR_MSG_ITEM_TEMP
    Call BATTLE_SUBSCRIPT_HELD_ITEM_RAISE_STAT
    GoTo _end
